<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" data-table-id="UserTable">
    <div class="layui-card-body padding-left-40">

        <fieldset class="layui-bg-gray">
            <legend><b class="layui-badge think-bg-violet">名称</b></legend>

            <div class="layui-row layui-col-space15">
                <div class="layui-col-xs5">
                    <label class="block relative">
                        <span class="help-label"><b>名称</b></span>
                        {if isset($vo) and isset($vo.adname)}
                        <input name="adname" value='{$vo.adname|default=""}' required  class="layui-input think-bg-gray">
                        {else}
                        <input name="adname" value='{$vo.adname|default=""}' required  vali-name="名称" placeholder="请输入名称" class="layui-input">
                        {/if}
                        <span class="help-block"></span>
                    </label>
                </div>
                <div class="layui-col-xs2">
                    <label class="relative block">
                        <span class="help-label"><b>类型</b></span>
                        <div>
                          <select name="adtype" id="adtype">                           
                              <option value="1" {if isset($vo.adtype) and $vo.adtype == 1}selected='selected'{/if}>图片</option>
                              <option value="2" {if isset($vo.adtype) and $vo.adtype == 1}selected='selected'{/if}>文字</option>
                          </select>
                        </div>
                    </label>
                </div>
                <div class="layui-col-xs4">
                    <div class="layui-form-item">
                        <label class="layui-form-label">{:lang('图标')}</label>
                        <div class="layui-input-block">
                            <div class="layui-textarea help-images">
                                <input type="hidden" value="{$vo.adimg|default=''}" name="adimg">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </fieldset>

        <fieldset class="layui-bg-gray">
            <label class="layui-form-item block relative margin-top-10">
                <span class="help-label"><b>URL</b></span>
                 <input name="adurl" value='{$vo.adurl|default=""}' required  vali-name="URL" placeholder="URL" class="layui-input">
            </label>
            
            <label class="layui-form-item block relative margin-top-10">
                <span class="help-label"><b>简介</b></span>
                <textarea placeholder="请输入简介" class="layui-textarea" name="addesc">{$vo.actdesc|default=""}</textarea>
            </label>
        </fieldset>

    </div>

    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}

    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
</form>

<script>
    $('[name=adimg]').uploadOneImage(); 
</script>